<?php
namespace src;
require 'view/sview.lib.php';
use src\sview;
use classlib\core as C;
class Cindex {
	public function main() {
		(isset($_GET['debug']) && C\config::env() != 'pro')? sview::debug():sview::init();
		if (!isset($_SERVER['HTTP_ACTION']) || substr_count($_SERVER['HTTP_ACTION'], '-') != 2) {
			sview::error(506, 'core');
		}
		list($moduleid, $sfuncode) = explode('-', $_SERVER['HTTP_ACTION'], 2);
		switch ($moduleid) {
			case 0://系统接口相关
				require 'sys/main.lib.php';
				break;
			/*
			case 1:
				//登录/注册、找回密码安全接口相关
				require 'safe/main.lib.php';
				break;
			case 2:
				//主播广场相关操作
				require 'explore/main.lib.php';
				break;
			case 3:
				//会员相关操作
				require 'profile/main.lib.php';
				break;
			case 4:
				//首页相关操作
				require 'home/main.lib.php';
				break;
			case 5:
				//主播间相关
				require 'live/main.lib.php';
				break;
			case 6:
				//主播间相关V2.0
				require 'livev2/main.lib.php';
				break;
				*/
			default:
				sview::error(510, 'core', $_SERVER['HTTP_ACTION']);
		}
		\src\Amain::main($sfuncode);
	}
}